import Vue from 'vue'

// 引入初始化的样式文件
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
// 导入饿了么UI相关的资源
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n 语言包

import '@/styles/index.scss' // global css 引入全局样式文件

// 引入根组件
import App from './App'
// 引入vuex实例
import store from './store'
// 引入路由实例
import router from './router'
// 引入图标
import '@/icons' // icon
import '@/permission' // permission control
// import PageTools from '@/components/PageTools'
// Vue.component('PageTools', PageTools)
// const obj = {
//   install(p) {
//     console.log('install.......')
//     p.component('PageTools', PageTools)
//   }
// }
import myUI from '@/components'
Vue.use(myUI)

if (process.env.NODE_ENV === 'development') {
  console.log('开发环境')
} else {
  console.log('生产环境')
}
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// 引入mock假数据
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// 注册ElementUI并配置语言包
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
